<template>
  <div id="userinfo">
    <Row class="restand">
      <i-col class="standkepudigndan" span="17">
        <div class="standardt">
          用户信息
        </div>
        <div class="result">
          <Row class="orderrow">
            <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" >
                <Form-item class="formitemre" label="用户名" prop="account" :label-width="90">
                    <i-input disabled class="userinfoinput" v-model="formValidate.account" type="text" ></i-input>
                </Form-item>
                <Form-item class="formitemre" label="邮箱" prop="email" :label-width="90">
                    <i-input disabled class="userinfoinput" v-model="formValidate.email" type="text" ></i-input>
                </Form-item>
                <Form-item class="formitemre" label="手机号" prop="mobile" :label-width="90">
                    <i-input disabled class="userinfoinput" v-model="formValidate.mobile" type="text" ></i-input>
                </Form-item>
                <Form-item class="formitemre" label="真实姓名" prop="realName" :label-width="90">
                    <i-input disabled class="userinfoinput" v-model="formValidate.realName" type="text" ></i-input>
                </Form-item>
                <Form-item class="formitemre" label="联系电话" prop="telephone" :label-width="90">
                    <i-input disabled class="userinfoinput" v-model="formValidate.telephone" type="text" ></i-input>
                </Form-item>
                <Form-item class="formitemre" label="公司" prop="CompanyName" :label-width="90">
                    <i-input disabled class="userinfoinput" v-model="formValidate.CompanyName" type="text" ></i-input>
                </Form-item>
                <Form-item class="formitemre" label="地址" prop="Address" :label-width="90">
                    <i-input disabled class="userinfoinput" v-model="formValidate.Address" type="text" ></i-input>
                </Form-item>
                <!-- <Form-item>
                    <i-button type="primary" class="registerconfirm" @click="handleRegister('formValidate')">提交</i-button>
                    <i-button type="ghost" class="registerreset" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
                </Form-item> -->
            </Form>
          </Row>
        </div>
      </i-col>
    </Row>
  </div>
</template>

<script>
import {neturl} from '../assets/js/common'
export default {
  name: 'seniorsearch',
  data () {
    return {
      msg: '内蒙古标准文献服务平台',
      theme1: 'light',
      byname: 'bymenu',
      value: '',
      showPage: false,
      userinfo: '',
      islogin: false,
      islog: true,
      username: '',
      tatolDeposit: '',
      tatolPoint: '',
      formValidate: {
        account: '',
        email: '',
        mobile: '',
        telephone: '',
        Address: '',
        CompanyName: '',
        realName: ''
      },
      userinfomation: ''
    }
  },
  methods: {
    getSearchResult () {
      this.$axios.get(neturl + '/by/adms/user/info?token=' + this.userinfo.token + '&loginMark=' + this.userinfo.loginMark
      ).then(res => {
        // console.log(res)
        this.userinfomation = res.data.data.baseinfo
        this.formValidate.account = this.userinfomation.account
        this.formValidate.email = this.userinfomation.email
        this.formValidate.mobile = this.userinfomation.mobile
        this.formValidate.telephone = this.userinfomation.telephone
        this.formValidate.Address = this.userinfomation.Address
        this.formValidate.CompanyName = this.userinfomation.CompanyName
        this.formValidate.realName = this.userinfomation.realName
        this.$Spin.hide()
      })
    },
    handleRegister (name) {
      // this.$refs[name].validate((valid) => {
      //   if (valid) {
      //     // 修改密码提交
      //     this.modal2 = true
      //   } else {
      //     this.$Message.error('验证失败!')
      //   }
      // })
    },
    handleReset (name) {
      // this.$refs[name].resetFields()
    }
  },
  created () {
    this.$Spin.show()
    // this.model1 = this.cityList[0].value
    this.userinfo = this.$cookie.get('user')
    if (this.userinfo === null) {
      this.$router.push('/login')
    }
    this.userinfo = JSON.parse(this.userinfo)
    // 已登录
    if (this.userinfo != null) {
      this.islogin = true
      this.islog = false
      this.username = this.userinfo.realName
    }
    this.getSearchResult()
  }
}
</script>
<style scoped>
  @import '../assets/css/userinfo.css';
</style>
